import request from '@/utils/request'
import { getToken } from '@/utils/token'
// export const getChannelListAPI = () => request({
//   url: '/v1_0/channels'
// })

// 登录认证
export const LoginAPI = ({ mobile, code }) => request({
  url: '/v1_0/authorizations',
  method: 'POST',
  data: {
    mobile,
    code
  }
})

// 获取用户已选频道列表
export const getChnannelList = () => request({
  url: '/v1_0/user/channels',
  headers: {
    Authorization: `Bearer ${getToken()}`
  }
})

// 获取文章列表
export const getArticleListAPI = (channel_id) => request({
  url: '/v1_0/articles',
  headers: {
    Authorization: `Bearer ${getToken()}`
  },
  params: {
    channel_id,
    timestamp: new Date()
  }
})
